package com.example.mydemoproject.job;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.sql.Timestamp;

/**
 * @author LiuZhiYong
 * @description 示例不带参数的定时任务
 * @date 2022-11-25
 **/
@Slf4j
public class SampleJob implements Job {

    @SneakyThrows
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("不带参数的示例定时任务开始: {}", new Timestamp(System.currentTimeMillis()));
        Thread.sleep(10000);
        log.info("不带参数的示例定时任务结束: {}", new Timestamp(System.currentTimeMillis()));
    }
}
